using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using LigerUi.MVC.DataModel.EntityClasses.Models.Mapping;

namespace LigerUi.MVC.DataModel.EntityClasses.Models
{
    public partial class MVCEntities : DbContext
    {
        static MVCEntities()
        {
            Database.SetInitializer<MVCEntities>(new CreateDatabaseIfNotExistsMap());
        }

        public MVCEntities()
            : base("Name=MVCEntities")
        {
        }

        public DbSet<CF_Company> CF_Company { get; set; }
        public DbSet<CF_Department> CF_Department { get; set; }
        public DbSet<CF_Employee> CF_Employee { get; set; }
        public DbSet<CF_Privilege> CF_Privilege { get; set; }
        public DbSet<CF_User> CF_User { get; set; }
        public DbSet<CF_UserRole> CF_UserRole { get; set; }
        public DbSet<PhoneAttribution> PhoneAttributions { get; set; }
        public DbSet<Sys_Button> Sys_Button { get; set; }
        public DbSet<Sys_ButtonClass> Sys_ButtonClass { get; set; }
        public DbSet<Sys_Menu> Sys_Menu { get; set; }
        public DbSet<Sys_MenuController> Sys_MenuController { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new CF_CompanyMap());
            modelBuilder.Configurations.Add(new CF_DepartmentMap());
            modelBuilder.Configurations.Add(new CF_EmployeeMap());
            modelBuilder.Configurations.Add(new CF_PrivilegeMap());
            modelBuilder.Configurations.Add(new CF_UserMap());
            modelBuilder.Configurations.Add(new CF_UserRoleMap());
            modelBuilder.Configurations.Add(new PhoneAttributionMap());
            modelBuilder.Configurations.Add(new Sys_ButtonMap());
            modelBuilder.Configurations.Add(new Sys_ButtonClassMap());
            modelBuilder.Configurations.Add(new Sys_MenuMap());
            modelBuilder.Configurations.Add(new Sys_MenuControllerMap());
        }
    }
}
